package vip.george.springbootiptools.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.HandlerInterceptor;
import vip.george.springbootiptools.service.IpToolService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class IpToolInterceptor implements HandlerInterceptor {


    @Autowired
    private IpToolService ipToolService;

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        // 统计请求信息
        ipToolService.count();
        return true;
    }
}
